/*
 * Copyright (c) 2023, 2023,yzc.cn All rights reserved.
 *
 */
package cn.yzc.controller;

import cn.yzc.client.GoodsRemoteClient;
import cn.yzc.pojo.Good;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>Project: SpringColud - GoodController</p>
 * <p>Powered by yzc On 2023-12-29 14:23:33</p>
 * <p>描述：<p>
 *
 * @author yzc [yzc0415@126.com]
 * @version 1.0
 * @since 17
 */
@RestController
public class GoodController implements GoodsRemoteClient {


    @Override
    public Map get(String id) {
        Map map =new HashMap<>();
        map.put("id",id);
        map.put("name","华为手机");
        map.put("price",4999.0);
        return map;
    }

    @Override
    public Map query(int page, int pageSize, String name) {
        Map map =new HashMap<>();
        map.put("page",page);
        map.put("pageSize",pageSize);
        map.put("name",name);
        return map;
    }

    @Override
    public Map queryMap(Map map) {
        map.put("info","map接受多参");
        return map;
    }

    @Override
    public Map queryGood(Good good) {
        Map map =new HashMap<>();
        map.put("code",200);
        map.put("msg","请求成功");
        map.put("data",good);
        return map;
    }

    @Override
    public Map queryId(int id) {
        Map map =new HashMap<>();
        map.put("code",200);
        map.put("msg","请求成功");
        map.put("data",id);
        return map;
    }
}
